{include file="header.tpl.php"}


<div class="titleFull">

	<div class="wrapper">

		<h1 style="line-height: 100px; margin: 0px;">Request Payment</h1>

	</div>

</div>


<div class="titleBlueBar"></div>




<div class="content2">

	<div class="wrapper">

		<div class="h30"></div>

		<div class="boxLeft2">





			<h3>Request A Payment</h3>
			 

			<!--Form Area-->

			{if $error_msg ne ""}
				  <div class="error">{$error_msg}</div>
			{elseif $success_msg ne ""}
				  <div  class="success">{$success_msg}</div>
			{/if}


		  {if $cashout_available ne "0" && $cdate eq "yes"} 
		   <form action="cashout.php" method="post" id="payform">
		   <input type="hidden" name="availableBalance" id="availableBalance" value="{$available_money}" />

		   <table cellspacing="8" style="width:670px; border: 1px solid #bbb;">
		   <tr><td>Amount</td><td><input type="text" name="amount" value="{$amount}"  onblur="calculateCost()" id="amt" maxlength="8" /></td></tr>   
		   <tr><td>Fee</td><td><span id="fee" style="color:#252525; font-weight:bold">$0.00</span></td></tr>
		   <tr><td>Payment Method</td><td><select name="method" onchange="changeMethodName()" id="cMethod" style="width:145px"><option value="paypal" {if $method eq "paypal"} selected="selected" {/if} > Paypal </option><option  value="payza" {if $method eq "payza"} selected="selected" {/if} > Payza </option><!-- <option  value="Moneybookers" {if $method eq "Moneybookers"} selected="selected" {/if} > Moneybookers (Skrill) </option><option value="Wire" {if $method eq "Wire"} selected="selected" {/if}>Wire</option><option value="WesternUnion" {if $method eq "WesternUnion"} selected="selected" {/if}>Western Union</option> --></select></td></tr>
		   <tr id="emailCon"><td id="cmn" style="width:150px;">Paypal Email</td><td><input type="text" name="email_address" value="{$email}" /></td></tr>
		   <tr id="notesArea"><td style="width:150px;">Details</td><td><textarea name="notes"></textarea></td></tr>
		   <tr><td>Cashout Type</td><td><select name="priority" onchange="calculateCost()" id="costCal" style="width:145px"><option value="normal" > Normal - (0% fee) </option>{if $QUICK_PAY_AVAILABLE eq "1"} <option  value="quick" > Quick - ( {if $QUICK_PAY_FLAT_FEE gt "0"} ${$QUICK_PAY_FLAT_FEE} {elseif $QUICK_PAY_FEE gt "0"} {$QUICK_PAY_FEE*100}% {else} $0 {/if}  fee) </option> {/if}</select></td></tr>


		   <tr><td>&nbsp;</td><td><input type="hidden" name="cashout" value="cashout" />
		   <br><input type="submit" class="button" value="Cashout" title="Cashout" name="cashout_btn" onclick="submitNow(this)" /></td></tr>
		   </table>

			{literal}
			<script type="text/javascript">
			function submitNow(e)
			{
				$('#payform').submit();
				e.disabled=true;
			}
			</script>
			{/literal}


		   {if $type ne "" && $method eq "Check"}
		   <script type="text/javascript">
		   toggleCheckArea('{$type}');
		   </script>
		   {else}

		   {/if}
		   <script type="text/javascript">
		   changeMethodName();
		   </script>

 
			</form>

			{elseif $cdate eq "no"}
  
  
		  {if $C_DATE2 gt $C_DATE1}
		  
		  <div class="green">Cashout form will be available from day-{$C_DATE1} to day-{$C_DATE2} of each month.</div>
		  
		  {else}
		  
		  <div class="green">Cashout form will be available on day-{$C_DATE1} of each month.</div>      
		  
		  {/if}

			{elseif $pendingRequests eq "1"}
			<div class="green">You already have a pending cashout request.</div>
			{else}
			<div>Cashout form will only appear when you reach balance equal or more then minimum cashout limit.</div>
			{/if}
		  
			<br>
			<div class="blue"><b>Available Cash: ${$total_earnings}</b></div>

		<!--End Form-->


		<br />


      <!--Payment History Area-->
       <h3>Recent Payouts</h3>

	   <table class="table" cellspacing="0">
		  <tr>
			   <th>Date</th><th>Amount</th><th>Method</th><th>Type</th><th>Status</th>{if $history ne ''}<th>&nbsp;</th>{/if}
		  </tr>
		   
			{if $history ne ''}
		  {foreach item=transaction from=$history}
		  
		  <tr style="background:#{cycle values='ffffff,f0f0f0'}; height:25px"><td>{$transaction.date}</td><td>${$transaction.cash}</td><td>{$transaction.method} {if $transaction.method eq "Check"}({$transaction.type}){/if}</td><td>{if $transaction.priority eq "quick"}<span style="color:#F00"><b>{$transaction.priority}</b></span>{else}{$transaction.priority}{/if}</td><td align="center">{if $transaction.status eq "Locked"}In Process{else}{$transaction.status}{/if}</td><td align="center">{if $transaction.status eq "Pending"}<form action="cashout.php" method="post" id="form_request_{$transaction.id}"> <input type="hidden" name="request_id" value="{$transaction.id}" /><select style="width: 120px;" name="cancelCashout" onblur="cancelRequest('request_{$transaction.id}')" id="request_{$transaction.id}"><option value="0">Select Action</option><option value="cancel">Cancel</option></select></form>{/if}</td></tr>
		  
		  {/foreach}
		  
		  {else}	  
			  <tr style="background:#fff"><td colspan="5" style="text-align:center; border:0px;">Payment history not available.</td></tr>
		  {/if}	  
		   
	  </table>
	 <!--End Payment History Area-->



	</div>



<!--Right Panel-->
{include file="sidebar.tpl.php"}
<!--End Right Panel-->


{include file="footer.tpl.php"}